package com.syni.mdd.sjb.common.datatreaure.controller.protect.dataTreasure.saasminapp;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.controller.BaseController;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.databank.MemberRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.*;
import com.syni.mdd.sjb.common.datatreaure.service.databank.saasminapp.MemberService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/minApp/member")
public class MemberController extends BaseController {

    @Autowired
    private MemberService memberService;

    @PostMapping("/getIndexData")
    @ApiOperation(value = "获取会员管理主页数据")
    @CheckUserIdentity
    public Map<String,Object> getIndexData(@RequestBody MemberRqVo memberRqVo){
        return memberService.getIndexData(memberRqVo);
    }

    @PostMapping("/getAnalysisData")
    @ApiOperation(value = "获取会员消费分析数据")
    @CheckUserIdentity
    public Map<String,Object> getAnalysisData(@RequestBody MemberRqVo memberRqVo){
        return memberService.getAnalysisData(memberRqVo);
    }

    @PostMapping("/getGrowRules")
    @ApiOperation(value = "获取会员成长规则")
    @CheckUserIdentity
    public Map<String,Object> getGrowRules(@RequestBody MemberRqVo memberRqVo){
        return memberService.getGrowRules(memberRqVo);
    }

    @PostMapping("/getNetShopData")
    @ApiOperation(value = "获取主页订单数据")
    @CheckUserIdentity
    public Map<String,Object> getNetShopData(@RequestBody MemberRqVo memberRqVo){
        return memberService.getNetShopData(memberRqVo);
    }

    @PostMapping("/getServiceInfo")
    @ApiOperation(value = "获取当前店铺服务信息")
    @CheckUserIdentity
    public Map<String,Object> getServiceInfo(@RequestBody MemberRqVo memberRqVo){
        return memberService.getServiceInfo(memberRqVo);
    }

    @PostMapping("/updateGrowRules")
    @ApiOperation(value = "更新会员成长规则")
    @CheckUserIdentity
    public Map<String,Object> updateGrowRules(@RequestBody UpdateRuleRqVo updateRuleRqVo){
        return memberService.updateGrowRules(updateRuleRqVo);
    }

    @PostMapping("/getGrowRulesTimes")
    @ApiOperation(value = "获取会员成长规则设置次数")
    @CheckUserIdentity
    public Map<String,Object> getGrowRulesTimes(@RequestBody MemberRqVo memberRqVo){
        return memberService.getGrowRulesTimes(memberRqVo);
    }

    @PostMapping("/updateMemberLevel")
    @ApiOperation(value = "更新会员级别设置")
    @CheckUserIdentity
    public Map<String,Object> updateMemberLevel(@RequestBody UpdateLevelRqVo updateLevelRqVo){
        return memberService.updateMemberLevel(updateLevelRqVo);
    }

    @PostMapping("/getLevelConfig")
    @ApiOperation(value = "获取会员成长规则设置次数")
    @CheckUserIdentity
    public Map<String,Object> getLevelConfig(@RequestBody GetLevelConfigRqVo getLevelConfigRqVo){
        return memberService.getLevelConfig(getLevelConfigRqVo);
    }

    @PostMapping("/countDataByStore")
    @ApiOperation(value = "统计店铺用户余额记录")
    @CheckUserIdentity
    public Map<String,Object> countDataByStore(@RequestBody MemberRqVo memberRqVo){
        return memberService.countDataByStore(memberRqVo);
    }

    @PostMapping("/recordListByStore")
    @ApiOperation(value = "统计店铺储值卡数据")
    @CheckUserIdentity
    public Map<String,Object> recordListByStore(@RequestBody RecordByStoreVo recordByStoreVo){
        return memberService.recordListByStore(recordByStoreVo);
    }


    @PostMapping("/getRechargeRule")
    @ApiOperation(value = "获取指定店铺的充值规则")
    @CheckUserIdentity
    public Map<String,Object> getRechargeRule(@RequestBody RechargeRuleVo rechargeRuleVo){
        return memberService.getRechargeRule(rechargeRuleVo);
    }

    @PostMapping("/setRechargeRule")
    @ApiOperation(value = "设定指定店铺的充值规则")
    @CheckUserIdentity
    public Map<String,Object> setRechargeRule(@RequestBody RechargeRuleVo rechargeRuleVo){
        return memberService.setRechargeRule(rechargeRuleVo);
    }

    @PostMapping("/getSeckillList")
    @ApiOperation(value = "获取秒杀活动列表")
    @CheckUserIdentity
    public Map<String,Object> getSeckillList(@RequestBody SeckillListVo seckillListVo){
        return memberService.getSeckillList(seckillListVo);
    }

    @PostMapping("/getSeckillDetail")
    @ApiOperation(value = "获取秒杀活动详情")
    @CheckUserIdentity
    public Map<String,Object> getSeckillDetail(@RequestBody SeckillDetailVo seckillDetailVo){
        return memberService.getSeckillDetail(seckillDetailVo);
    }

    @PostMapping("/createSeckill")
    @ApiOperation(value = "创建秒杀活动")
    @CheckUserIdentity
    public Map<String,Object> createSeckill(@RequestBody CreateSeckillVo createSeckillVo){
        return memberService.createSeckill(createSeckillVo);
    }

    @PostMapping("/updateSeckill")
    @ApiOperation(value = "更新秒杀活动")
    @CheckUserIdentity
    public Map<String,Object> updateSeckill(@RequestBody UpdateSeckillVo updateSeckillVo){
        return memberService.updateSeckill(updateSeckillVo);
    }

    @PostMapping("/endSeckill")
    @ApiOperation(value = "手动结束秒杀活动")
    @CheckUserIdentity
    public Map<String,Object> endSeckill(@RequestBody SeckillDetailVo seckillDetailVo){
        return memberService.endSeckill(seckillDetailVo);
    }

    @PostMapping("/getGoodList")
    @ApiOperation(value = "获取商品列表")
    @CheckUserIdentity
    public Map<String,Object> getGoodList(@RequestBody GoodListVo goodListVo){
        return memberService.getGoodList(goodListVo);
    }

    @PostMapping("/getGroupBookingList")
    @ApiOperation(value = "获取拼团活动列表")
    @CheckUserIdentity
    public Map<String,Object> getGroupBookingList(@RequestBody SeckillListVo seckillListVo){
        return memberService.getGroupBookingList(seckillListVo);
    }

    @PostMapping("/getGroupBookingDetail")
    @ApiOperation(value = "获取拼团活动详情")
    @CheckUserIdentity
    public Map<String,Object> getGroupBookingDetail(@RequestBody SeckillDetailVo seckillDetailVo){
        return memberService.getGroupBookingDetail(seckillDetailVo);
    }

    @PostMapping("/createGroupBookingDetail")
    @ApiOperation(value = "创建拼团活动")
    @CheckUserIdentity
    public Map<String,Object> createGroupBookingDetail(@RequestBody CreateGroupBookingVo createGroupBookingVo){
        return memberService.createGroupBookingDetail(createGroupBookingVo);
    }

    @PostMapping("/updateGroupBookingDetail")
    @ApiOperation(value = "更新拼团活动")
    @CheckUserIdentity
    public Map<String,Object> updateGroupBookingDetail(@RequestBody UpdateGroupBookingVo updateGroupBookingVo){
        return memberService.updateGroupBookingDetail(updateGroupBookingVo);
    }

    @PostMapping("/endGroupBookingDetail")
    @ApiOperation(value = "更新拼团活动")
    @CheckUserIdentity
    public Map<String,Object> endGroupBookingDetail(@RequestBody SeckillDetailVo seckillDetailVo){
        return memberService.endGroupBookingDetail(seckillDetailVo);
    }

    @PostMapping("/getUserGroupBooking")
    @ApiOperation(value = "获取用户拼团列表")
    @CheckUserIdentity
    public Map<String,Object> getUserGroupBooking(@RequestBody SeckillDetailVo seckillDetailVo){
        return memberService.getUserGroupBooking(seckillDetailVo);
    }



}
